# -*- coding:utf-8 -*-

'''
Created on 2010-8-17

@author: madlee
'''

import wx
try:
    from agw import flatnotebook
except ImportError: # if it's not there locally, try the wxPython lib.
    from wx.lib.agw import flatnotebook

from kuai.kan.resource import txt
from kuai.kan.toolbars import ControlPanel

class MainFrame(wx.Frame):
    def __init__(self, *args, **kwargs):
        wx.Frame.__init__(self, *args, **kwargs)
        self.control_panel = ControlPanel(self, wx.ID_ANY)
        self._book = flatnotebook.FlatNotebook(self, wx.ID_ANY)
        
        s = wx.BoxSizer(wx.VERTICAL)

        s.Add(self.control_panel, 0, wx.EXPAND)
        s.Add(self._book, 1, wx.EXPAND)

        self.SetSizer(s)

        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
        self.Bind(wx.EVT_MENU, self.OnCloseMe, id=wx.ID_EXIT)
        
    def OnCloseWindow(self, event):
        self.Destroy()
        
    def OnCloseMe(self, event):
        self.Close(True)
        
